
use WebSecurity;
GO
-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_CATALOG = N'WebSecurity' 
	 AND SPECIFIC_SCHEMA = N'dbo'
     AND SPECIFIC_NAME = N'DomainName_udt' 
)
   DROP PROCEDURE dbo.DomainName_udt
GO
create procedure dbo.DomainName_udt
	@DomainNameID Int,
	@EmailDomain NVarChar(255),
	@DomainDeny Bit,
	@TS varbinary(8),
	@CreatedBy VarChar(50),
	@CreatedDt DateTime,
	@ModifiedBy VarChar(50),
	@ModifiedDt DateTime,
	@RowsAffected int = null OUTPUT 
	
--*************************************************************
--Created By: trooks
--Name: dbo_DomainName_udt
--Table: DomainName
--Database: WebSecurity
--Created Date: 01/21/2013 00:00:00
--*************************************************************

as
    Begin Try
		update [dbo].DomainName
        Set

		EmailDomain = @EmailDomain, 
		DomainDeny = @DomainDeny, 
		CreatedBy = @CreatedBy, 
		CreatedDt = @CreatedDt, 
		ModifiedBy = @ModifiedBy, 
		ModifiedDt = @ModifiedDt 
    where
		 @DomainNameID = DomainNameID
		AND @TS = TS
		Set @RowsAffected = @@ROWCOUNT;
		return 0;	
	END TRY
	BEGIN CATCH
		Set @RowsAffected = 0;
		EXEC dbo.uspLogError;
		return -1;
	END CATCH
	
GO
GRANT EXECUTE ON [WebSecurity].[dbo].[DomainName_udt] to PORTAL_WebSecurity
GO













